Continue
Continue
 
Parameters: NONE
Returns: NONE
 

      Continue allows the program flow to jump to the next iteration of a Do/Loop, For/Next, While/EndWhile, or Repeat/Until loop.




FACTS:


      * The compiler will report an error if the Continue statement is used outside of a loop

      * It's important to note that Continue does not stop a loop. It simply allows you to jump directly to the end of a loop and continue on with it. If you wish to jump completely out of a current loop use the Exit commands.




Mini Tutorial:


  
  
; run the loop while i is less than 10
  While i < 10
   ; increase i by 1
     Inc i
   ; if i equals 5 proceed to the next iteration.
     If i = 5
      ; Display a skip message
        Print "skipping>>"+Str$(i)
        
        
      ; Continue makes PB jump directly to the
      ; EndWhile statement.  When this occurs, the
      ; folling print will be ignored completely.
        Continue
        
     EndIf
     
   ; print the value
     Print "Loop:"+Str$(i)
     
  EndWhile
  
  
; Display the Screen and wait for the user to press a key
  Sync
  WaitKey
  
  
  




This example would output.

  
  Loop:1
  Loop:2
  Loop:3
  Loop:4
  skipping>>5
  Loop:6
  Loop:7
  Loop:8
  Loop:9
  Loop:10
  

 
Related Info: Exit | ExitDo | ExitFor | ExitFunction | ExitRepeat | ExitWhile | loops :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com